package org.kjtc.balanceService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.kjtc.balanceEntity.MeterManage;
import org.kjtc.service.BaseService;
import org.springframework.stereotype.Service;

@Service("meterManageService")
public class MeterManageService extends BaseService {

	@SuppressWarnings("unchecked")
	public List<MeterManage> getMeterManage(MeterManage meterManage) throws Exception{
		return (List<MeterManage>)this.getDaoSupport().findForList("T_MeterManage.getMeterManage", meterManage);
	}

	/*
	 * 添加
	 */
	public int insertMeterManage(MeterManage meterManage) throws Exception {
		return (int) this.getDaoSupport().save("T_MeterManage.insertMeterManage", meterManage);
	}

	public int insertMeterInfos(List<MeterManage> meterManageList) throws Exception {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("meterInfoList", meterManageList);
    	return (int)this.getDaoSupport().save("T_MeterManage.insertMeterInfos", map);
	}

	/* 修改
	 *
	 */
	public int updateMeterManage(MeterManage meterManage) throws Exception {
		return (int) this.getDaoSupport().update("T_MeterManage.updateMeterManage", meterManage);
	}

	/*
	 * 删除
	 */
	public int deleteMeterManage(MeterManage meterManage) throws Exception {
		return (int) this.getDaoSupport().update("T_MeterManage.deleteMeterManage", meterManage);
	}
}
